﻿using System;
using System.Collections.Generic;
using System.Text;

namespace mozhi.smarterp.Finance.DataDicts
{
    public class DataDictionary : AggregateRootBase<Guid>
    {
        /// <summary>
        /// 模块
        /// </summary>
        public string ModuleCode {  get; private set; }

        /// <summary>
        /// 键
        /// </summary>
        public string Key {  get; private set; }


        /// <summary>
        /// 键值
        /// </summary>
        public string Value {  get; private set; }


        private DataDictionary() { }

        public DataDictionary(Guid id , string moduleCode , string key , string value)
        {
            Id = id;
            ModuleCode = moduleCode;
            Key = key;
            Value = value;

            Validate();
        }

        #region
        private void Validate()
        {
            if(ModuleCode.IsNullOrEmpty())
                throw new ArgumentNullException(nameof(DataDictionary.ModuleCode));

            if(Key.IsNullOrEmpty())
                throw new ArgumentNullException(nameof(Key));
        }
        #endregion
    }
}
